import datetime as dt
from datetime import datetime


def getDateTime():
    iso_time = datetime.now().isoformat(sep=' ', timespec='seconds')
    return iso_time

def isToday(dateStr):
    today = dt.date.today()
    return datetime.strptime(dateStr,"%Y-%m-%d").date() == today

# date_string = f"{datetime.now():%Y-%m-%d %H:%M:%S}"
def getDate():
    return f"{datetime.now():%Y-%m-%d}"

def getYear():
    return f"{datetime.now():%Y}"

def getMonth():
    return f"{datetime.now():%m}"

def getDay():
    return f"{datetime.now():%d}"

# print(getDay())
# print(getDateTime())
# today = dt.date.today()
# print(today)
# print(today == "2025-08-30")
# print(today == dt.date(2025,8,30))
# dateStr ="2025-08-30"
# print(datetime.strptime(dateStr,"%Y-%m-%d") )
# print(datetime.strptime(dateStr,"%Y-%m-%d") == dt.date(2025,8,30))              # 这是一个datetime类型
# print(datetime.strptime(dateStr,"%Y-%m-%d").date() == dt.date(2025,8,30))       # .date() 转换成date 类型
# print(isToday("2025-08-30"))
